package com.ia.uniweb.model;

public class Student {

	
	/**
	 * <!--
	    ColumnFamily: Students
	    We'll store all the student data here.

	    Row Key => Students's registrationnumber (implies reg no must be unique)
	    Column Name: an attribute for the entry (name, dob, etc)
	    Column Value: value of the associated attribute

	    Access: get student by registration number (aka grab all columns from a specific Row)

	    Students : { // CF
	        1DS00TE018 : { // row key
	            // and the columns as "profile" attributes
	            firstName: Krishna,
	            lastName:sacharya
	            course:Electronics
	            courseYear: 2012,
	            email: krishna@example.com,
	            sex: Male
	        },
	        // and the other students
	        Student 2 {
	            ...
	        }
	    }
	-->
	 *
	 */
	private String firstName;
	
	private String lastName;
	
	private String middleName;
	
	private String dobDDMMYY;
	
	private Sex sex;
	
	private boolean active;
	
	private String registrationNumber;
	
	private int courseYear;

	private String course;

	public int getCourseYear() {
		return courseYear;
	}

	public void setCourseYear(int courseYear) {
		this.courseYear = courseYear;
	}

	public String getCourse() {
		return course;
	}

	public void setCourse(String course) {
		this.course = course;
	}

	public String getRegistrationNumber() {
		return registrationNumber;
	}

	public void setRegistrationNumber(String registrationNumber) {
		this.registrationNumber = registrationNumber;
	}
	
	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getMiddleName() {
		return middleName;
	}

	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}

	public String getDobDDMMYY() {
		return dobDDMMYY;
	}

	public void setDobDDMMYY(String dobDDMMYY) {
		this.dobDDMMYY = dobDDMMYY;
	}

	public Sex getSex() {
		return sex;
	}

	public void setSex(Sex sex) {
		this.sex = sex;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}
	public static Student getDefaultStudent(String search) {

		Student student = new Student();
		student.setFirstName((search != null && !search.isEmpty()) ? search
				: "Krishna");
		student.setLastName("Melkote");
		student.setDobDDMMYY("14/08/1982");
		student.setSex(Sex.MALE);
		student.setActive(true);
		student.setCourse("IT");
		student.setRegistrationNumber("1DS00TE018");

		return student;
	}

}
